﻿window.downloadFileFromBytes = (fileBytes, fileName, coutentType) => {
    const uint8Array = new Uint8Array(fileBytes);
    const blob = new Blob([uint8Array], { type: coutentType });

    const url = URL.createObjectURL(blob);

    const a = document.createElement('a');
    a.href = url;
    a.download = fileName;
    document.body.appendChild(a);
    a.click();
    document.body.removeChild(a);
    URL.revokeObjectURL(url);
}